﻿<div class="widget widget-table" ng-controller="FinanceDetailActiveOnlineCtrl">
    <div class="widget-header">
        <h3><i class="fa fa-table"></i> 海淘订单</h3>
    </div>
    <div class="widget-content">
        <div class="row">
            <div class="col-sm-12 search-bar">
                <div class="search-col">
                    <label class="search-label">交易类型：</label>
                    <select class="form-control search-control" ng-model="searchBar.type">
                        <option value="">全部</option>
                        <option value="1">运费</option>
                    </select>
                </div>
                <div class="search-col">
                    <label class="search-label">支付状态：</label>
                    <select class="form-control search-control" ng-model="searchBar.paidstatus">
                        <option value="">全部</option>
                        <option value="Unpaid">未支付</option>
                        <option value="Paid">已支付</option>
                        <option value="Arrears">运费不足</option>
                    </select>
                </div>
                <div class="search-col">
                    <label class="search-label">交易时间：</label>
                    <select class="form-control search-control" ng-model="searchBar.dateRange" ng-change="changeDate()">
                        <option value="">所有</option>
                        <option value="3">最近3天</option>
                        <option value="7">最近7天</option>
                        <option value="range">时间范围</option>
                    </select>
                </div>
                <div class="search-col" ng-show="searchBar.dateRange == 'range'">
                    <label class="search-label">开始日期：</label>
                    <p class="input-group pull-left">
                        <input type="text" class="form-control search-control" style="width:110px;"
                               uib-datepicker-popup
                               ng-model="searchBar.startDate"
                               is-open="searchBar.opened.startDate"
                               show-button-bar="false"
                               ng-click="searchBar.opened.startDate = true" />
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-default" ng-click="searchBar.opened.startDate = true"><i class="fa fa-calendar"></i></button>
                        </span>
                    </p>
                </div>
                <div class="search-col" ng-show="searchBar.dateRange == 'range'">
                    <label class="search-label">结束日期：</label>
                    <p class="input-group pull-left">
                        <input type="text" class="form-control search-control" style="width:110px;"
                               uib-datepicker-popup
                               ng-model="searchBar.endDate"
                               is-open="searchBar.opened.endDate"
                               show-button-bar="false"
                               ng-click="searchBar.opened.endDate = true" />
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-default" ng-click="searchBar.opened.endDate = true"><i class="fa fa-calendar"></i></button>
                        </span>
                    </p>
                </div>
                <div class="clearfix"></div>
                <div class="search-col">
                    <label class="search-label">搜索条目：</label>
                    <select class="form-control search-control" ng-model="searchBar.keywordType">
                        <option value="orderNumber">订单编号</option>
                        <option value="outBoundTrackingNumber">包裹跟踪号</option>
                    </select>
                    <input type="text" class="form-control search-control" style="margin-left:5px; width:480px;" placeholder="请输入查询关键字" ng-model="searchBar.keywords" />
                    <button type="button" class="btn btn-primary" style="margin-left:5px;" ng-click="btnSearch()">搜索</button>
                </div>
            </div>
        </div>
    </div>
    <table class="table table-bordered">
        <thead>
            <tr>
                <th>交易时间</th>
                <th>交易类型</th>
                <th>支付状态</th>
                <th>订单编号</th>
                <!--<th>商品编号</th>
                <th>商品描述</th>
                <th>包裹跟踪号</th>-->
                <th>受理仓库</th>
                <th>重量（磅）</th>
                <!--<th>金额（￥）</th>-->
                <th>订单已支付运费</th>
                <th>运费总额</th>
                <th>运费差额</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="item in dataList">
                <td>{{item.orderDate | date:'MM/dd/yyyy HH:mm:ss'}}</td>
                <td>运费</td>
                <td>{{item.Paidstatus}}</td>
                <td><a href="javascript:void(0);" ng-click="btnOpenDetail(item,'orderdetail')">{{item.orderNumber}}</a></td>
                <!--<td><span class="red">字段不明确</span></td>
                <td><span class="red">字段不明确</span></td>
                <td><span class="red">字段不明确</span></td>-->
                <td>{{item.warehouseName}}</td>
                <td>{{item.actualWeight}}</td>
                <td>￥{{item.shippingFee}}</td>
                <td>￥{{item.packageTotalFee}}</td>
                <td>￥{{item.shippingFeeAdjust}}</td>
                <td>
                    <a href="javascript:void(0)" ng-click="btnPay(item)" ng-show="item.orderStatus == 'Arrears'">余额支付</a>
                </td>
            </tr>
        </tbody>
    </table>
    <div class="row">
        <div class="col-sm-12 text-right">
            <uib-pagination class="pagination pagination-rewrite pull-right"
                            boundary-links="true"
                            max-size="5"
                            total-items="pagination.totalCount"
                            items-per-page="pagination.pageSize"
                            ng-model="pagination.pageIndex"
                            ng-change="getData()"
                            previous-text="上一页"
                            next-text="下一页"
                            first-text="首页"
                            last-text="尾页">
            </uib-pagination>
            <select class="form-control pull-right" style="width:70px;" ng-model="pagination.pageSize" ng-change="getData()">
                <option value="10">10</option>
                <option value="20">20</option>
                <option value="50">50</option>
                <option value="100">100</option>
            </select>
        </div>
    </div>
</div>